import request from '@/config/axios'

// 培训记录 VO
export interface TrainingInfoVO {
  id: number // id
  trainingTime: Date // 培训时间
  trainingSchool: string // 培训学校
  trainingAdress: string // 培训地址
  trainingContent: string // 培训内容
  trainingName: string // 培训名称
}

// 培训记录 API
export const TrainingInfoApi = {
  // 查询培训记录分页
  getTrainingInfoPage: async (params: any) => {
    return await request.get({ url: `/crm/training-info/page`, params })
  },

  // 查询培训记录详情
  getTrainingInfo: async (id: number) => {
    return await request.get({ url: `/crm/training-info/get?id=` + id })
  },

  // 新增培训记录
  createTrainingInfo: async (data: TrainingInfoVO) => {
    return await request.post({ url: `/crm/training-info/create`, data })
  },

  // 修改培训记录
  updateTrainingInfo: async (data: TrainingInfoVO) => {
    return await request.put({ url: `/crm/training-info/update`, data })
  },

  // 删除培训记录
  deleteTrainingInfo: async (id: number) => {
    return await request.delete({ url: `/crm/training-info/delete?id=` + id })
  },

  // 导出培训记录 Excel
  exportTrainingInfo: async (params) => {
    return await request.download({ url: `/crm/training-info/export-excel`, params })
  },
}